package 力扣日常刷题.木23一月.第02天302;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author 帅小伙
 * @date 2022/3/2
 * @description
 */
public class Demo16小美的跑腿代购 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        Integer[][] res = new Integer[n][2];
        for (int i = 0; i < n; i++) {
            int p = sc.nextInt();
            int w = sc.nextInt();
            res[i][0] = i;
            res[i][1] = p + 2 * w;

        }
        Arrays.sort(res, (a, b) -> {
            return b[1] - a[1];
        });
        int[] ans = new int[m];
        for (int i = 0; i < m && i < n; i++) {
            ans[i] = res[i][0] + 1;
        }
        Arrays.sort(ans);
        for (int i = 0; i < m; i++) {
            System.out.print(ans[i] + " ");
        }
    }

}




